package com.jay.codec.audio

import com.jay.codec.CodecUtils
import java.io.File

/**
 * @author xuzhou4
 * @date 2021/12/27
 */
object MP3Utils {

    fun mp3ToFlac(sourcePath: String, destPath: String): Int {
        val file = File(sourcePath)
        if (!file.exists()) {
            return -1
        }

        val destFile = File(destPath)
        if (destFile.parentFile?.exists() != true) {
            val success = destFile.parentFile?.mkdirs()
            if (success != true) {
                return -2
            }
        }

        return CodecUtils.mp3ToFlac(sourcePath, destPath)
    }
}